{extend  name="index/index" /}

<!-- 内容区域 -->
<div class="tpl-content-wrapper">
    {block name="main"}
    <div style="display: none" class="row-content am-cf">
                <div class="row  am-cf">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-4">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">月度财务收支计划</div>
                                <div class="widget-function am-fr">
                                    <a href="javascript:;" class="am-icon-cog"></a>
                                </div>
                            </div>
                            <div class="widget-body am-fr">
                                <div class="am-fl">
                                    <div class="widget-fluctuation-period-text">
                                        ￥61746.45
                                        <button class="widget-fluctuation-tpl-btn">
                                            <i class="am-icon-calendar"></i>
                                            更多月份
                                        </button>
                                    </div>
                                </div>
                                <div class="am-fr am-cf">
                                    <div class="widget-fluctuation-description-amount text-success" am-cf>
                                        +￥30420.56

                                    </div>
                                    <div class="widget-fluctuation-description-text am-text-right">
                                        8月份收入
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-4">
                        <div class="widget widget-primary am-cf">
                            <div class="widget-statistic-header">
                                本季度利润
                            </div>
                            <div class="widget-statistic-body">
                                <div class="widget-statistic-value">
                                    ￥27,294
                                </div>
                                <div class="widget-statistic-description">
                                    本季度比去年多收入 <strong>2593元</strong> 人民币
                                </div>
                                <span class="widget-statistic-icon am-icon-credit-card-alt"></span>
                            </div>
                        </div>
                    </div>
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-4">
                        <div class="widget widget-purple am-cf">
                            <div class="widget-statistic-header">
                                本季度利润
                            </div>
                            <div class="widget-statistic-body">
                                <div class="widget-statistic-value">
                                    ￥27,294
                                </div>
                                <div class="widget-statistic-description">
                                    本季度比去年多收入 <strong>2593元</strong> 人民币
                                </div>
                                <span class="widget-statistic-icon am-icon-support"></span>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row am-cf">
                    <div class="am-u-sm-12 am-u-md-8">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">月度财务收支计划</div>
                                <div class="widget-function am-fr">
                                    <a href="javascript:;" class="am-icon-cog"></a>
                                </div>
                            </div>
                            <div class="widget-body-md widget-body tpl-amendment-echarts am-fr" id="tpl-echarts">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row am-cf">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-4 widget-margin-bottom-lg ">
                        <div class="tpl-user-card am-text-center widget-body-lg">
                            <div class="tpl-user-card-title">
                                禁言小张
                            </div>
                            <div class="achievement-subheading">
                                月度最佳员工
                            </div>
                            <img class="achievement-image" src="/static/admin/main/assets/img/user07.png" alt="">
                            <div class="achievement-description">
                                禁言小张在
                                <strong>30天内</strong> 禁言了
                                <strong>200多</strong>人。
                            </div>
                        </div>
                    </div>

                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-8 widget-margin-bottom-lg">

                        <div class="widget am-cf widget-body-lg">

                            <div class="widget-body  am-fr">
                                <div class="am-scrollable-horizontal ">
                                    <table width="100%" class="am-table am-table-compact am-text-nowrap tpl-table-black "
                                           id="example-r">
                                        <thead>
                                        <tr>
                                            <th>文章标题</th>
                                            <th>作者</th>
                                            <th>时间</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr class="gradeX">
                                            <td>新加坡大数据初创公司 Latize 获 150 万美元风险融资</td>
                                            <td>张鹏飞</td>
                                            <td>2016-09-26</td>
                                            <td>
                                                <div class="tpl-table-black-operation">
                                                    <a href="javascript:;">
                                                        <i class="am-icon-pencil"></i> 编辑
                                                    </a>
                                                    <a href="javascript:;" class="tpl-table-black-operation-del">
                                                        <i class="am-icon-trash"></i> 删除
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr class="even gradeC">
                                            <td>自拍的“政治角色”：观众背对希拉里自拍合影表示“支持”</td>
                                            <td>天纵之人</td>
                                            <td>2016-09-26</td>
                                            <td>
                                                <div class="tpl-table-black-operation">
                                                    <a href="javascript:;">
                                                        <i class="am-icon-pencil"></i> 编辑
                                                    </a>
                                                    <a href="javascript:;" class="tpl-table-black-operation-del">
                                                        <i class="am-icon-trash"></i> 删除
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr class="gradeX">
                                            <td>关于创新管理，我想和你当面聊聊。</td>
                                            <td>王宽师</td>
                                            <td>2016-09-26</td>
                                            <td>
                                                <div class="tpl-table-black-operation">
                                                    <a href="javascript:;">
                                                        <i class="am-icon-pencil"></i> 编辑
                                                    </a>
                                                    <a href="javascript:;" class="tpl-table-black-operation-del">
                                                        <i class="am-icon-trash"></i> 删除
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr class="even gradeC">
                                            <td>究竟是趋势带动投资，还是投资引领趋势？</td>
                                            <td>着迷</td>
                                            <td>2016-09-26</td>
                                            <td>
                                                <div class="tpl-table-black-operation">
                                                    <a href="javascript:;">
                                                        <i class="am-icon-pencil"></i> 编辑
                                                    </a>
                                                    <a href="javascript:;" class="tpl-table-black-operation-del">
                                                        <i class="am-icon-trash"></i> 删除
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr class="even gradeC">
                                            <td>Docker领域再添一员，网易云发布“蜂巢”，加入云计算之争</td>
                                            <td>醉里挑灯看键</td>
                                            <td>2016-09-26</td>
                                            <td>
                                                <div class="tpl-table-black-operation">
                                                    <a href="javascript:;">
                                                        <i class="am-icon-pencil"></i> 编辑
                                                    </a>
                                                    <a href="javascript:;" class="tpl-table-black-operation-del">
                                                        <i class="am-icon-trash"></i> 删除
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
    <div class="row-content am-cf">
        <div class="row">
            <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                <div class="widget am-cf">
                    <div class="widget-head am-cf">
                        <div class="widget-title  am-cf">活动列表</div>


                    </div>
                    <div class="widget-body  am-fr">

                        <div class="am-u-sm-12">
                            <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black"
                                   id="example-r">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>名称</th>
                                    <th>介绍</th>
                                    <th>优惠总金额</th>
                                    <th>学员报名优惠金额</th>
                                    <th>推荐人奖励</th>
                                    <th>开始时间</th>
                                    <th>截止日期</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {volist name="list" id="data" }
                                <tr class="gradeX">
                                    <td>{$data.id}</td>
                                    <td>{$data.name}</td>
                                    <td>
                                        <div class="am-text-truncate" style="width: 100px;">{$data.introduce}</div>
                                    </td>
                                    <td>{$data.total}</td>
                                    <td>{$data.concession}</td>
                                    <td>{$data.reward}</td>
                                    <td>{$data.starttime}</td>
                                    <td>{$data.endtime}</td>
                                    <td>
                                        <div class="tpl-table-black-operation">
                                            <a href="{:url('admin/Activity/check', ['id'=>$data.id])}">
                                                <i class="am-icon-pencil"></i> 查看
                                            </a>
                                            <a href="{:url('admin/Activity/edit', ['id'=>$data.id])}">
                                                <i class="am-icon-pencil"></i> 编辑
                                            </a>
                                            <!--<a href="{:url('admin/Activity/delete', ['id'=>$data.id])}" class="tpl-table-black-operation-del del-btn">-->
                                                <!--<i class="am-icon-trash"></i> 删除-->
                                            <!--</a>-->
                                            <button class="am-btn-danger del" data-aid="{$data.id}">删除</button>
                                        </div>
                                    </td>
                                </tr>
                                {/volist}

                                <!-- more data -->
                                </tbody>
                            </table>
                        </div>

                    </div>

                    <!--<div class="am-u-lg-12 am-cf">-->

                        <!--<div class="am-fr">-->


                            <!--<ul class="am-pagination tpl-pagination">-->
                                <!--<li><a href="?page=1">首页</a></li>-->
                                <!--<li class=""><a href="?page=1">&laquo;</a></li>-->
                                <!--<li class="am-active"><a href="?page=1">1</a></li>-->
                                <!--<li class="am-active"><a href="?page=2">2</a></li>-->
                                <!--<li class="am-active"><a href="?page=3">3</a></li>-->
                                <!--<li><a href="disabled">&raquo;</a></li>-->
                                <!--<li><a href="#">尾页</a></li>-->
                            <!--</ul>-->
                        <!--</div>-->
                    <!--</div>-->

                </div>
            </div>
        </div>
    </div>
    {/block}
</div>



{block name="myjs"}
<script>
    $(function (){
        $('.del').click(function (){
            var aid = $(this).attr('data-aid');
            var obj = $(this).parents('tr');
            if (confirm('您确定要删除该活动吗？')) {
                delAjax(aid, obj);
            }
        });
    });

    function delAjax(id, obj) {
        $.ajax({
            type: "get",
            url: "{:url('admin/Activity/delete')}",
            dataType: "json",
            data: {
                'id': id
            },
            success: function (data){
                if (data.status == 1) {
                    alert('活动删除成功');
                    obj.remove();
                } else {
                    alert('活动删除失败');
                }
            }
        });
    }

</script>
{/block}